package com.system.userconsumer.feign;

import com.system.userconsumer.domain.Address;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author Lisiyu
 * date 2022/10/19 23:06
 * version 1.0
 */
//通过接口的方式声明式的访问远程服务器
@FeignClient(name = "addressprovidereureka04")
public interface AddressFeign {

    @GetMapping("/address/info/{id}")
    Address findAddressById(@PathVariable Integer id);
    @GetMapping("/address/nameid")
    Address findByNameAndId(@RequestParam(name = "id") Integer id,@RequestParam(name = "name") String name);
    @PostMapping("/add")
    int addAddress(@RequestBody Address address);
}
